﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


/**
* @Author: AdinZ
* @Q  Q : 1454269
* @Email:adinz@adinz.com
* @Created: 2014/5/23 23:26:51
*
* */
namespace Reader.Api.Alipay
{
    /// <summary>
    /// 类名：Config
    /// 功能：基础配置类
    /// 详细：设置帐户有关信息及返回路径
    /// 版本：3.3
    /// 日期：2012-07-05
    /// 说明：
    /// 以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
    /// 该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
    /// 
    /// 如何获取安全校验码和合作身份者ID
    /// 1.用您的签约支付宝账号登录支付宝网站(www.alipay.com)
    /// 2.点击“商家服务”(https://b.alipay.com/order/myOrder.htm)
    /// 3.点击“查询合作者身份(PID)”、“查询安全校验码(Key)”
    /// </summary>
    public class Config
    {


        public static string HOST = "http://localhost:2143/api/pay/";

        #region 字段
        private static string partner = "";
        private static string key = "";

        private static string private_key = "";
        private static string public_key = "";
        private static string input_charset = "";
        private static string sign_type = "";
        private static string sign_type_ = "";

        public static string Sign_type_
        {
            get { return Config.sign_type_; }
            set { Config.sign_type_ = value; }
        }
        #endregion

        static Config()
        {
            //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

            //合作身份者ID，以2088开头由16位纯数字组成的字符串
            partner = "2088411610615416";
            key = "5wg9q9qclanb7dvn6v05aaly031ir433";
            //商户的私钥
            private_key = @"MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMOv/cCTqbbPrajKv9ouE7kS+OW7tnEzH7MxpRhtn/2y7g0ZZ8aR6ZrulU+UEsHs8WGPfAUUwI3fgGH/sPbTaEcEfHTuqPz00CGvFam4s4q3DhvbqRrlwRhy48CmKjzcotY6I4Wk/5V25pCqNGATZvtCzqf4EIxxh30UqSNV4LR5AgMBAAECgYEAm9Zor1co3aQP+Q7VsEvnewjH3DQb+5QqF4tendCXi/NVrmrgAPusXKzJjWEveu5V4ErjCizXl2Q5GlIEvNvo+tfA2BG8gLtKrrzk4gMJK3ylJ51AcgSKqUHJ263SVQf+YY5cxlqMvZFZfHlmNkhnm+n5cEFY+KQZcvphNK3BY40CQQDy7rfy2m2OzxA0cQeD6/e4xRc8HdWs7Ax38ODPygVxmBQVFB5PFbwSRCaHjToe1EjLFkzNeh0vtdPCOt6Knq3fAkEAzjawYTJSZm8MpQ8btHUZEvO2f5KSnTYATxWsaM+71qRuZGIEHUx+iUZkQTfHyjalr+amIaZF6Xk3x87UVzu4pwJAMgIoRcrnMLW5XUJDTMnfhd60qMBvgxhYfLxOWxf4ROkMgUZR8u/DdnMnB1JwO3ZxwbTGfKn9phulCt+5fgmqOwJAb0en6uui99AZfMEobDt8qnOGGlXYdKn9hK/neDAR54SYZedW3RC4gA/SbjdRw1e2FbRcFnCJ7bISXerJP8HkpQJAPpHHQq+lu1lizJuGlus/iEt7NA9Rfoaj24CwDjSTW36ZiUe9DjggEwHsA+2TO3vkQoD4pRF6ACyCquXzfjY7/A==";

            //支付宝的公钥，无需修改该值
            public_key = @"MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnxj/9qwVfgoUh/y2W89L6BkRAFljhNhgPdyPuBV64bfQNN1PjbCzkIM6qRdKBoLPXmKKMiFYnkd6rAoprih3/PrQEB/VsW8OoM8fxn67UDYuyBTqA23MML9q1+ilIZwBC2AQ2UBVOrFXfFl75p6/B5KsiNG9zpgmLCUYuLkxpLQIDAQAB";

            //↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑



            //字符编码格式 目前支持 gbk 或 utf-8
            input_charset = "utf-8";

            //签名方式，选择项：RSA、DSA、MD5
            sign_type = "RSA";


            //签名方式，选择项：0001(RSA)、MD5
            sign_type_ = "0001";
            //无线的产品中，签名方式为rsa时，sign_type需赋值为0001而不是RSA
        }

        #region 属性
        /// <summary>
        /// 获取或设置合作者身份ID
        /// </summary>
        public static string Partner
        {
            get { return partner; }
            set { partner = value; }
        }

        /// <summary>
        /// 获取或设置商户的私钥
        /// </summary>
        public static string Private_key
        {
            get { return private_key; }
            set { private_key = value; }
        }

        /// <summary>
        /// 获取或设置支付宝的公钥
        /// </summary>
        public static string Public_key
        {
            get { return public_key; }
            set { public_key = value; }
        }

        /// <summary>
        /// 获取字符编码格式
        /// </summary>
        public static string Input_charset
        {
            get { return input_charset; }
        }

        /// <summary>
        /// 获取签名方式
        /// </summary>
        public static string Sign_type
        {
            get { return sign_type; }
        }

        public static string Key
        {
            get { return Config.key; }
            set { Config.key = value; }
        }
        #endregion
    }
}
